#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 55;

int n;
int a[N];
ll dp[N][10];
bool check() {
  rep(i, 1, n - 1) if (abs(a[i] - a[i + 1]) > 1) return false;
  return true;
}
void solve() {
  string s;
  cin >> s;
  n = s.size();
  rep(i, 0, n - 1) a[i + 1] = s[i] - '0';
  rep(i, 0, 9) dp[n][i] = 1;
  per(i, n - 1, 1) {
    rep(j, 0, 9) {
      int x = j + a[i + 1];
      int k = x / 2;
      dp[i][j] = dp[i + 1][k];
      if (x & 1) dp[i][j] += dp[i + 1][k + 1];
    }
  }
  ll sum = 0;
  rep(i, 0, 9) sum += dp[1][i];
  sum -= check();
  cout << sum;
  return;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int t = 1;
  while (t--) solve();
  return 0;
}